Rank by elementary transformation